# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Contributor: Orion <systmkor@gmail.com>
# Maintainer: Sören Tempel <soeren+alpine@soeren-tempel.net>
pkgname=terminus-font
pkgver=4.48
pkgrel=0
pkgdesc="Monospace bitmap font (for X11 and console)"
url="http://terminus-font.sourceforge.net/"
arch="noarch"
license="custom"
depends=""
depends_dev=""
makedepends="bdftopcf fontconfig mkfontscale mkfontdir python3"
options="!check"
install=""
subpackages="$pkgname-doc"
source="https://downloads.sourceforge.net/project/$pkgname/$pkgname-$pkgver/$pkgname-$pkgver.tar.gz"

builddir="$srcdir"/$pkgname-$pkgver
build() {
	cd "$builddir"
	make \
		prefix=/usr \
		x11dir=/usr/share/fonts/misc \
		psfdir=/usr/share/consolefonts
}

package() {
	cd "$builddir"
	make \
		prefix=/usr \
		x11dir=/usr/share/fonts/misc \
		psfdir=/usr/share/consolefonts \
		DESTDIR="$pkgdir" install \
		|| return 1

	install -d "$pkgdir"/usr/share/doc/$pkgname
	install -Dm655 README README-BG \
		"$pkgdir"/usr/share/doc/$pkgname/ || return 1

	install -Dm644 75-yes-terminus.conf \
		"$pkgdir"/etc/fonts/conf.avail/75-yes-terminus.conf
	install -Dm644 OFL.TXT \
		"$pkgdir"/usr/share/licenses/$pkgname/LICENSE

	install -d "$pkgdir/etc/fonts/conf.d"
	cd "$pkgdir/etc/fonts/conf.d"
	ln -s ../conf.avail/75-yes-terminus.conf . || return 1
}

sha512sums="5f45f7d0e7396f02158f4751aaafb3f0a3fb68dbe3e5501f86a5138c6d52f5106053e38c368d560e5979e29250074dbde5165702b8905a564d029663a2219af4  terminus-font-4.48.tar.gz"
